//
//  CollectionMinHeaderFooterView.m
//  MZBasic
//
//  Created by Sings on 2019/9/7.
//

#import "CollectionMinHeaderFooterView.h"
#import "CollectionViewMinHeaderFooterViewModel.h"

@interface CollectionMinHeaderFooterView ()

@property (nonatomic, strong) CollectionViewMinHeaderFooterViewModel *viewModel;

@end

@implementation CollectionMinHeaderFooterView

@dynamic viewModel;

+ (instancetype) baseCollectionHeaderFooterViewWithCollectionView:(BaseCollectionView *)collectionView AndKind:(NSString *)kind AndIndexPath:(NSIndexPath *)indexPath {
    CollectionMinHeaderFooterView *headerFooterView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:[self CollectionHeaderFooterReuseIdentifier] forIndexPath:indexPath];
    
    return headerFooterView;
}

- (instancetype) initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
//        self.backgroundColor = [UIColor groupTableViewBackgroundColor];
        BZTHEME_COLOR(skin_page_bg_color,self,backgroundColor);
    }
    return self;
}

- (void) showView {
    if (self.viewModel.height == 0 || self.viewModel.width == 0) {
        self.alpha = 0.;
    }else {
        self.alpha = 1.;
    }
}

@end
